<!--conf
<sample>
              <product version="1.6" edition="pro"/>
                     <modifications>
                            <modified date="070101"/>
                     </modifications>
               </sample>
 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
   <title>Loading from JSArray</title>
</head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
<body>
   <h1>Loading from JSArray</h1>
   <p>There is a possibility to load data from JS Array. You can load data from an array object or a file.</p>
   <table>
      <tr>
         <td>
            <div id="treeboxbox_tree" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"/>
         </td>
         <td rowspan="2" style="padding-left:25" valign="top">
   <a href="javascript:void(0)" onClick="tree.deleteChildItems(0);  eval('var z='+document.getElementById('a12').value); tree.loadJSArray(z);">
reload from JS array (textarea)
</a>         <br/>
<a href="javascript:void(0)" onClick="tree.deleteChildItems(0); tree.loadJSArrayFile('../common/data.js');">
load from external JS array data file
</a>
         </td>
      </tr>
   </table>
       

<textarea id="a12" rows="8" cols="40">[[1,0,"1111"],
[2,0,"2222"],
[3,0,"3333"],
[4,2,"child"]]</textarea>

	<script>
var tree = new dhtmlXTreeObject('treeboxbox_tree', '100%', '100%', 0); 
tree.setSkin('dhx_skyblue');
tree.setImagePath("../../../codebase/imgs/dhxtree_skyblue/");
tree.enableDragAndDrop(true);
tree.loadJSArray([   [1,0,"1111"],
               [2,0,"2222"],
               [3,0,"3333"],
               [4,2,"child"]])
	</script>
	
	
	<p> Format of JS array.
		<br>Tree item is represented with three values as sub-arrays of the top array - id, parent_id, text.
	The order of rows in JS array doesn't matter.</br></p>


</body>
</html>

